package com.platform.server.util;

import org.apache.log4j.Logger;

public class LogUtil {

	private final static Logger log = Logger.getLogger(LogUtil.class);

	public static void callLog(StringBuffer parameter, long times) {
		times = System.currentTimeMillis() - times;
		log.info(parameter.toString() + "; elapse=" + times);
	}

	public static void callLog(StringBuffer parameter, String result, long times) {
		times = System.currentTimeMillis() - times;
		log.info(parameter.toString() + " ; result=" + result + "; elapse=" + times);
	}

	public static void info(Object content) {
		log.info(content);
	}

	public static void info(Logger log, Object... content) {
		if (null == content) {
			return;
		}
		StringBuilder builder = new StringBuilder();
		for (Object obj : content) {
			builder.append(obj.toString());
		}
		log.info(builder.toString());
	}

	public static void debug(String method, Object result) {
		log.debug("mthod:" + method + ";result:" + result);
	}

	public static void info(String method, Object result) {
		log.info("mthod:" + method + ";result:" + result);
	}

	public static void warn(String method, Object result) {
		log.warn("mthod:" + method + ";result:" + result);
	}

	public static void error(String method, Object result) {
		log.error("mthod:" + method + ";result:" + result);
	}

}
